from pydantic import BaseModel
from typing import Optional, List, Dict

class SiteStats(BaseModel):
    total_sites: int
    active_sites: int
    inactive_sites: int

class ClusterStats(BaseModel):
    cluster_name: str
    site_count: int

class SiteInfo(BaseModel):
    序号: int
    群组名称: str
    站点名称: str
    站点状态: str
    站点分类: str
    站点上线日期: str | None
    排序字段: float
class SiteListItem(BaseModel):
    id: str
    cluster_name: str
    name: str
    site_status: int
    site_cat: int
    installed_date: str | None
    order: float

class ReportResponse(BaseModel):
    site_stats: SiteStats
    cluster_stats: List[ClusterStats]
    site_list: List[SiteInfo]

# 添加新的分页响应模型
class PaginatedSiteList(BaseModel):
    success: str
    data: dict
    site_statistics: dict | None

class AlarmGradeStats(BaseModel):
    alarm_grade: int
    alarm_grade_name: str
    count: int

class AlarmStatisticsResponse(BaseModel):
    success: str
    data: List[AlarmGradeStats]
    message: Optional[str] = None
